{if !empty($smarty.session.userid)}
<!-- Begin javascript.tpl -->
<script language="javascript" type="text/javascript">
<!-- Begin javascript -->
{if ($smarty.session.debugger eq "on" or $smarty.get.debug eq "on") 
and $smarty.get.debug ne "off"}
  debugwin = window.open('','DebugWin','toolbar=no,scrollbars=yes,resizable=yes,width=640,height=480');
  debugwin.document.writeln('<html>');
  debugwin.document.writeln('<head>');
  debugwin.document.writeln('<title>Issue Tracker Debugger</title>');
  debugwin.document.writeln('<link rel="stylesheet" type="text/css" href="css/{$cssfile}" />');
  debugwin.document.writeln('</head>');
  debugwin.document.writeln('<body>');
  debugwin.document.writeln('<table width="100%" class="borders" border="0" cellspacing="0" cellpadding="2">');
  debugwin.document.writeln('<tr><td class="tablehead">Debug Window</td></tr>');
{/if}
var timerID = null
var timerRunning = false
var sessionExpired = false
var startDate
var startSecs

function loader()
{ldelim}
  startDate = new Date()
  startSecs = (startDate.getHours() * 60 * 60) + (startDate.getMinutes() * 60) + startDate.getSeconds()

  if (timerRunning)
    clearTimeout(timerID)

  check_session()
{rdelim}

function unloader()
{ldelim}
{if ($smarty.session.debugger eq "on" or $smarty.get.debug eq "on")
and $smarty.get.debug ne "off"}
  debugwin.window.close();
{/if}
{rdelim}

function check_session()
{ldelim}
  var now = new Date()
  var nowSecs = (now.getHours() * 60 * 60) + (now.getMinutes() * 60) + now.getSeconds()
  var elapsedSecs = nowSecs - startSecs;

{if $smarty.session.prefs.session_timeout eq "t"}
  if (elapsedSecs == {php}print(ini_get("session.gc_maxlifetime") - 300);{/php})
    alert('Your {$smarty.const._TITLE_} session will expire in 5 minutes!');

  if (elapsedSecs >= {php}print(ini_get("session.gc_maxlifetime"));{/php} && !sessionExpired) {ldelim}
    sessionExpired = true;
    alert('Your {$smarty.const._TITLE_} session has expired!');
  {rdelim}
{/if}

  timerID = setTimeout("check_session()",1000)
  timerRunning = true
{rdelim}

{if $smarty.session.prefs.local_tz eq "t"}
/* Retrieve user's timezone */
var d = new Date()
if (d.getTimezoneOffset) {ldelim}
  var iMinutes = d.getTimezoneOffset()
  document.cookie = "tz=" + (iMinutes / 60)
{rdelim}
{/if}

<!-- Function of show or hide tree -->
function ExpandCollapseList(elem)
{ldelim}
	var path = elem.src.substring(0,elem.src.length - 8);

	var ul = document.getElementById('U'+elem.name);
	if (ul.style.display != "block")
	{ldelim}
		  ul.style.display = "block";
		  elem.src = path+"minu.gif";	
	{rdelim}
	else
	{ldelim}
	      elem.src = path+"plus.gif";
		  ul.style.display = "none";
	{rdelim}
{rdelim}
<!-- Function of show or hide tree -->
function expandCollapseList(ul,cName,itemId)
{ldelim}
	if(!ul.childNodes || ul.childNodes.length==0)
		return false;
	for(var itemi=0;itemi<ul.childNodes.length;itemi++)
	{ldelim}
		var item = ul.childNodes[itemi];
		if(itemId!=null && item.id==itemId)
			return true;
		if(item.nodeName == "LI")
		{ldelim}
			var subLists = false;
			for(var sitemi=0;sitemi<item.childNodes.length;sitemi++)
			{ldelim}
				var sitem = item.childNodes[sitemi];
				if(sitem.nodeName=="UL")
				{ldelim}
					subLists = true;
					var ret = expandCollapseList(sitem,cName,itemId);
					if(itemId!=null && ret)
					{ldelim}	
						item.className=cName;
						return true;
					{rdelim}
				{rdelim}
			{rdelim}
			if(subLists && itemId==null)
					alert(ul.childNodes.length);
				item.className = cName;
		{rdelim}
	{rdelim}
{rdelim}
<!-- Function of hide -->
function hide(pl_id) 
{ldelim}
document.getElementById(pl_id).style.visibility =  'hidden';
{rdelim}
<!-- Function of show -->
function show(pl_id)
{ldelim}
document.getElementById(pl_id).style.visibility =  'visible';
{rdelim}

<!-- Function of show or hide group_issues -->
function ShowHideIssues(elem)
{ldelim}
var idelem = elem.id
var id_block='gi'+idelem.substring(1,idelem.length);
var id_td='gitd'+idelem.substring(1,idelem.length);
block=document.getElementById(id_block);
if(block.style.display == "block"){ldelim}
  block.style.display = "none";
  elem.innerHTML = '+';
{rdelim}else{ldelim}
  block.style.display = "block";
  elem.innerHTML = '-';
{rdelim}
{rdelim}
<!-- End Javascript -->
</script>
<!-- End javascript.tpl -->
{/if}



